home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YAMscripts.lha / ChangeConfig.rexx < prev    next >
OS/2 REXX Batch file  |  1997-05-16  |  1KB  |  57 lines

  1. /* Changes the YAM's configuration. v 1.0 by Kai Nikulainen
  2. **
  3. ** Because there is no ARexx command for loading a configuration file, the
  4. ** script needs to quit YAM and then start it again with another config.
  5. **
  6. ** If you leave the opts.x variable empty YAM will check for new mail as soon
  7. ** as the new configuration is loaded.
  8. **
  9. ** If you have any problems or suggestions, mail knikulai@utu.fi
  10. */
  11.  
  12. options results
  13. call addlib('rexxsupport.library',0,-30,0)    /* Delay needs this */
  14.  
  15. /*
  16. ** Change the following variables to suit your system:
  17. */
  18.  
  19. configs=2        /* Number of different configurations */
  20. file.1='YAM:.config'    /* Config file 1 */
  21.  but.1='_Normal'    /* Requester button for config 1.  _ means keyboard shortcut */
  22.  dir.1='YAM:'        /* Maildir for this configuration */
  23. opts.1='NOCHECK'    /* Usable options here are NOCHECK, HIDE, DEBUG, POP3=xxxx */
  24.             /* and SMTP=xxxx.  The variable can be left empty */
  25.  
  26. file.2='YAM:.testconfig'
  27.  but.2='_Test'
  28.  dir.2='YAM:'
  29. opts.2='NOCHECK'
  30.  
  31. text='Change configuration to'
  32.  
  33. /*
  34. ** You shouldn't need to change anything below....
  35. */
  36.  
  37. buttons=''
  38. do i=1 to configs
  39.     buttons=buttons || but.i || '|'
  40.     end
  41. buttons=buttons || '_Cancel'
  42.  
  43. address 'YAM' 
  44. 'request "'text'" "'buttons'"'
  45. if result=0 then exit
  46. i=result
  47.  
  48. 'Quit'
  49. call delay(50)
  50.  
  51. do while pos(p,'YAM')    /* Just to make sure YAM isn't running anymore */
  52.     call delay(50)    /* It is probably unnecessary */
  53.     end
  54.  
  55. address command 'run >nil: YAM:YAM prefsfile='file.i 'maildir='dir.i opts.i
  56. exit
  57.